package cn.cs.service;

import cn.cs.mapper.AgentProductManageMapper;
import cn.cs.pojo.AgentShop;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController
public class AgentProductManageService {
    @Resource
    private AgentProductManageMapper manageMapper;


    @RequestMapping(value = "/cellProdctList", method = RequestMethod.POST)
    @Transactional
    List<Map<String,Object>> cellProdctList(@RequestParam("id") String id){
        return  manageMapper.cellProdctList();
    }
//    @RequestMapping(value = "/getAgentShopByAgentId", method = RequestMethod.POST)
//    @Transactional
//    AgentShop getAgentShopByAgentId(@RequestParam("id")String id){
//        return manageMapper.getAgentShopByAgentId(id);
//    }
    @RequestMapping(value = "/addCellProdct", method = RequestMethod.POST)
    @Transactional
    int addCellProdct(@RequestBody Map<String, Object> pro){
        return  manageMapper.addCellProdct(pro);
    }
    @RequestMapping(value = "/insertCellProImg", method = RequestMethod.POST)
    @Transactional
    int insertCellProImg(@RequestBody Map<String, Object> map){
        return manageMapper.insertCellProImg(map);
    }
    @RequestMapping(value = "/updateCellProdct", method = RequestMethod.POST)
    @Transactional
    int updateCellProdct(@RequestBody Map<String, Object> pro){
        return manageMapper.updateCellProdct(pro);
    }
    @RequestMapping(value = "/deleteProImageById", method = RequestMethod.POST)
    @Transactional
    int deleteProImageById(@RequestParam("id") String id){
        return manageMapper.deleteProImageById(id);
    }
    @RequestMapping(value = "/getProImageById", method = RequestMethod.POST)
    @Transactional
    Map<String,Object> getProImageById(@RequestParam("id") String id){
        return manageMapper.getProImageById(id);
    }
    @RequestMapping(value = "/deleteProdct", method = RequestMethod.POST)
    @Transactional
    int deleteProdct(@RequestParam("id") String id){
        return manageMapper.deleteProdct(id);
    }
}
